package com.example.sourcecodelearning.modules.statemachine.listener;

import org.springframework.statemachine.annotation.OnTransition;
import org.springframework.statemachine.annotation.WithStateMachine;
import org.springframework.stereotype.Component;

/**
 * 另一种写法参考{@link BasketballMusicStateMachineEventListener}
 */
@Component
@WithStateMachine
public class StateMachineListener {

    @OnTransition(target = "IDLE")
    public void IDLE() {
        System.out.println("IDLE...");
    }

    @OnTransition(target = "PLAYING_BB")
    public void PLAYING_BB() {
        System.out.println("PLAYING_BB...");
    }

    @OnTransition(target = "SINGING")
    public void SINGING() {
        System.out.println("SINGING...");
    }
}
